Do "bare" repositories by default
authorColin Walters <walters@verbum.org>
Wed, 19 Oct 2011 21:45:00 +0000 (17:45 -0400)
committerColin Walters <walters@verbum.org>
Wed, 19 Oct 2011 21:45:00 +0000 (17:45 -0400)
Mixing the repository and checkouts is discouraged.

Makefile-src.am
src/libostree/ostree-repo.c
src/libostree/ostree-types.h [deleted file]
src/libostree/ostree.h
src/ot-builtin-init.c

index 68cd3b520f9ed54861900db8f6b6f500730a8eed..2c600d5f0d2eeea5f0387ffbbf867c5541637428 100644 (file)
@@ -37,7 +37,6 @@ libostree_la_SOURCES = src/libostree/ostree.h \
        src/libostree/ostree-core.h \
        src/libostree/ostree-repo.c \
        src/libostree/ostree-repo.h \
-       src/libostree/ostree-types.h \
        $(NULL)
 libostree_la_CFLAGS = -I$(srcdir)/src/libostree -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(GIO_UNIX_CFLAGS)
 libostree_la_LIBADD = libotutil.la $(GIO_UNIX_LIBS)
index 4c5b10bcc2b1adaa91853a2d2cab7797ffbed1e0..0dfe67d30c6859f71c823b2fd493ab7570a8e9be 100644 (file)
@@ -133,8 +133,9 @@ ostree_repo_constructor (GType                  gtype,
   g_assert (priv->path != NULL);
   
   priv->repo_file = ot_util_new_file_for_path (priv->path);
-  priv->head_ref_path = g_build_filename (priv->path, OSTREE_REPO_DIR, "HEAD", NULL);
-  priv->objects_path = g_build_filename (priv->path, OSTREE_REPO_DIR, "objects", NULL);
+  
+  priv->head_ref_path = g_build_filename (priv->path, "HEAD", NULL);
+  priv->objects_path = g_build_filename (priv->path, "objects", NULL);
 
   return object;
 }
diff --git a/src/libostree/ostree-types.h b/src/libostree/ostree-types.h
deleted file mode 100644 (file)
index 5b306b3..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
- *
- * Copyright (C) 2011 Colin Walters <walters@verbum.org>.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Author: Colin Walters <walters@verbum.org>
- */
-
-#ifndef __OSTREE_TYPES_H__
-#define __OSTREE_TYPES_H__
-
-#include <gio/gio.h>
-
-G_BEGIN_DECLS
-
-#define OSTREE_REPO_DIR ".ot"
-
-G_END_DECLS
-
-#endif
index 75cced5f4828f8ae4f390433b8068eea6713f785..329d7c71e8bb1ce26e6ce06daa30526ca86fb987 100644 (file)
@@ -23,6 +23,5 @@
 
 #include <ostree-core.h>
 #include <ostree-repo.h>
-#include <ostree-types.h>
 
 #endif
index 9d86464538a3839e990f5838801879bcc0eaa501..7e952af49573e1d2271f83c1dfc5b8576cfd17cf 100644 (file)
@@ -37,12 +37,12 @@ ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error)
 {
   GOptionContext *context = NULL;
   gboolean ret = FALSE;
-  char *htdir_path = NULL;
+  char *otdir_path = NULL;
   char *objects_path = NULL;
-  GFile *htdir = NULL;
+  GFile *otdir = NULL;
   GFile *objects_dir = NULL;
 
-  context = g_option_context_new ("- Check the repository for consistency");
+  context = g_option_context_new ("- Initialize a new empty repository");
   g_option_context_add_main_entries (context, options, NULL);
 
   if (!g_option_context_parse (context, &argc, &argv, error))
@@ -51,13 +51,7 @@ ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error)
   if (repo_path == NULL)
     repo_path = ".";
 
-  htdir_path = g_build_filename (repo_path, OSTREE_REPO_DIR, NULL);
-  htdir = ot_util_new_file_for_path (htdir_path);
-
-  if (!g_file_make_directory (htdir, NULL, error))
-    goto out;
-
-  objects_path = g_build_filename (htdir_path, "objects", NULL);
+  objects_path = g_build_filename (repo_path, "objects", NULL);
   objects_dir = g_file_new_for_path (objects_path);
   if (!g_file_make_directory (objects_dir, NULL, error))
     goto out;
@@ -66,7 +60,7 @@ ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error)
  out:
   if (context)
     g_option_context_free (context);
-  g_free (htdir_path);
-  g_clear_object (&htdir);
+  g_free (otdir_path);
+  g_clear_object (&otdir);
   return ret;
 }